package com.laiketui.order.controller;


import com.laiketui.order.api.dto.ExamineOrderDTO;
import com.laiketui.order.api.dto.ExamineOrderDetailDTO;
import com.laiketui.order.api.dto.OrderOfflineExamineDTO;
import com.laiketui.order.api.params.OrderInfoParams;

import com.laiketui.order.api.params.mch.MchOrderInfoParams;
import com.laiketui.order.api.params.store.ExamineOrderParams;
import com.laiketui.order.domain.OrderOfflineExamine;
import com.laiketui.order.entity.ExamineOrderDetailEntity;
import com.laiketui.order.service.ExamineOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/v2/examineOrder")
public class ExamineOrderController {

    @Autowired
    private ExamineOrderService examineOrderService;

    /**
     * 审核订单
     * @param params
     * @return
     */
    @RequestMapping("/examine")
    public String examine(@RequestBody ExamineOrderParams params){
        return examineOrderService.examineOrder(params);
    }

    /**
     * 审核支付详情
     */
    @RequestMapping("/examineInfo")
    public ExamineOrderDetailDTO examineInfo(@RequestBody OrderInfoParams params){
        return examineOrderService.examineInfo(params);
    }

    /**
     * 财务订单审核详情列表
     */
    @RequestMapping("/examineList")
    public List<OrderOfflineExamineDTO> examineList(@RequestBody OrderInfoParams params){
        return examineOrderService.examineList(params);
    }

    /**
     * 财务订单详情
     */
    @RequestMapping("/orderDetails")
    public ExamineOrderDTO orderDetails(@RequestBody MchOrderInfoParams params){
        return examineOrderService.orderDetails(params);
    }

    @RequestMapping("/returnWaitPay")
    public String returnWaitPay(@RequestParam("orderParentNo") String orderParentNo){
        return examineOrderService.returnWaitPay(orderParentNo);
    }

}
